package com.des1gn.api;

import com.des1gn.service.RetryFaultProcess;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName RetryFaultTaskController
 * @Description 重试任务api
 * @Author Des1gn
 * @Version 1.0
 **/
@RestController
@RequestMapping("api")
@Slf4j
@RequiredArgsConstructor
public class RetryFaultTaskController {

    private final RetryFaultProcess retryFaultProcess;

    @GetMapping("list")
    public Map<Object, Object> list(){
        return retryFaultProcess.getRetryFaultTaskList();
    }

    @GetMapping("invoke")
    public Boolean invoke(String id){
        return retryFaultProcess.invokeRetryFaultTask(id);
    }

}
